<template>
  <teleport to="body">
    <!--自定义提示弹窗-->
    <div class="alert" v-show="props.msg !== ''">
      <div class="alert_con">
        <div class="alert_title">{{ props.msg }}</div>
      </div>
    </div>
  </teleport>
</template>

<script setup>
import {defineProps} from "vue";

const props = defineProps({
  msg: {
    type: String,
    default: ''
  }
})
</script>

<style scoped>
/* 自定义对话框 */
.alert {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  text-align: center;
}

.alert .alert_con {
  margin: 20% auto;
  border-radius: 10px;
  /* height: 55px; */
  display: inline-block;
  width: auto;
  background: black;
  color: white;
}

.alert .alert_con .alert_title {
  margin: 0 auto;
  /* padding-top: 4%; */
  padding: 10px;
  /* white-space: nowrap; */
}
</style>